-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phpstan 2.x #408
base: 2.x
Are you sure you want to change the base?
phpstan 2.x #408
Conversation
Thanks for the effort. The docblocks in the Model classes are very useful for auto-completion. why did you remove them? |
Besides, I would start with phpstan itself instead of larastan and with level 1 |
Just did a quick check on my local wth phpstan itself. found 9 errors on level 1 and 256 errors on level 2. shouldn't be difficult to fix them. |
Because some of them were wrong ( Lines 293 to 296 in dfdd50b
Phpstan without Larastan doesn't work, because Larastan is what makes sense of the loads of 'magic' in Laravel. There's also a level 0, but level 0 and 1 and 2 are all simple enough. |
Many of those 256 might be easy, and some of them will be impossible, because of Laravel's PHP magic. Larastan 'fixes' that with its Phpstan extensions. You also need fewer inline |
I think its just configuration, it has worked on Laravel itself. should be easy to make it work on Vito as well. |
You can copy Larastan functionality, but why would you? That's why Larastan exists. It sounds like you're against Larastan specifically. Why? I like it. It covers all the Laravel magic, you can code like you're used to. You can even keep all the class Anyway, you're the boss, you decide if and how you want static analysis. I think it already found a few issues even at level 2. |
When the 2 |
Many of those are Filament errors, but Filament doesn't provide Phpstan extensions, so you'd need to better type, and/or make custom extensions. I think. I don't know Filament at all. |
Lets keep this open for a bit. Need to think more. Still have a bit of doubts of adding phpstan or not 🤔 |
It is a hassle getting it to work, but when it does it's nice to have an extra layer of protection. |
I totally agree with the need for such tool as the bigger the project goes and more contributors come in, we need more protection. I need to figure out what setup is the best for Vito. |
Phpstan is very useful for finding flaws, even at level 2. Larastan makes it work for Laravel projects. Your IDE might be less happy, if it doesn't have great Laravel support like Larastan provides for Phpstan. I don't have a 'smart' IDE at all, so it works like a charm for me. Several dubious findings:
auto_update
andsecurity_updates
come from? According toServer
they're database columns, but I can't find them. Not even in old migrations/git history.connect($sftp)
call decides which it's gonna be. A generic on the SSH class could help, but that feels odd. Feels like it should be 2 classes.